<?php

    $use= $_GET['username'];
    $pass=$_GET['pass'];
    
    $con = mysqli_connect('localhost','xin','123456','xin');
    $sql="SELECT * FROM `user` WHERE `name` = '$use' AND `password` = '$pass'";
    $res=mysqli_query($con,$sql);
    if(!$res){
        die('数据库错误' . mysqli_error($con));
    }
    // print_r($res);
    $row = mysqli_fetch_assoc($res);
    if(!$row){
        die('错误');
    }
    print_r('正确');
    // setcookie('login',$use,time()+4200);
    //登录之后跳转的页面
    // header('location:html/inde.html');

    // print_r(json_encode($row,JSON_UNESCAPED_UNICODE));
?>